import json
from django.shortcuts import render
from rest_framework.generics import RetrieveUpdateDestroyAPIView, RetrieveDestroyAPIView, ListCreateAPIView
from rest_framework.request import Request
from rest_framework.response import Response
from django.http import JsonResponse

from .serializers import BookSerializers
from .models import BookInfo
# Create your views here.


class BookView(RetrieveDestroyAPIView, RetrieveUpdateDestroyAPIView):
    queryset = BookInfo.objects.all()  # 指定查询集
    serializer_class = BookSerializers  # 指定序列化器


class BooksView(ListCreateAPIView):
    queryset = BookInfo.objects.all()
    serializer_class = BookSerializers

